<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>select</title>
    <script src="https://cdn.staticfile.org/jquery/1.10.2/jquery.min.js"></script>
</head>
<script>
    $(function(){
        //ajax请求
        $("#ajaxBtn").click( function() {
            $.ajax({
                url:"http://localhost:8080/web_mybatis/product",
                data:"",
                type:"GET",
                success:function(data) {
                    alert("服务器返回的数据是:" + data.data);
                    // str = "学号：" + data.data.name + "，  性命：" + data.data.stuNum;
                    // console.log("学号：" + data.data.name + "，  性命：" + data.data.stuNum)
                    // document.getElementById("div02").innerHTML = str;
                },
                dataType:"json"
            })
        });
    });
</script>
<body>
    <button id="ajaxBtn">获取所有商品信息</button>
</body>
</html>